from django.conf.urls import url

from apps.users import views
from apps.users.views import UsernameCountView, MobileCountView, LogoutView, UserCenterView, AddressView, \
    ChangePasswordView, UserOrderInfoView
from apps.verifications.views import EmailView

urlpatterns = [
    url(r'^register/$', views.RegisterView.as_view(), name="register"),
    url(r'^usernames/(?P<username>[a-zA-Z0-9_]{5,20})/count/$', UsernameCountView.as_view(), name='count'),
    url(r'^mobiles/(?P<mobile>1[3-9]\d{9})/count/$', MobileCountView.as_view(), name='count_mobile'),
    url(r'^login/$', views.LoginView.as_view(), name='login'),
    url(r'^logout/$', LogoutView.as_view(), name='logout'),
    url(r'^usercenter/$', UserCenterView.as_view(), name='user_center'),
    url(r'^emails$', EmailView.as_view(), name='emails'),
    url(r'^address/$', AddressView.as_view(), name='address'),
    url(r'^password/$', ChangePasswordView.as_view(), name='password'),  # 修改密码
    url(r'^orders/info/(?P<page_num>\d+)/$', UserOrderInfoView.as_view(), name='user_order'),  # 用户订单
]


